load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel/go:go_test.bzl", "go_test")

go_library(
    name = "deploy",
    srcs = [
        "deploy.go",
        "download.go",
        "service.go",
        "systemdaction_string.go",
        "wrappers.go",
    ],
    importpath = "github.com/edgelesssys/constellation/v2/debugd/internal/debugd/deploy",
    visibility = ["//debugd:__subpackages__"],
    deps = [
        "//debugd/internal/filetransfer",
        "//debugd/service",
        "//internal/constants",
        "@com_github_coreos_go_systemd_v22//dbus",
        "@com_github_spf13_afero//:afero",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//credentials/insecure",
    ],
)

go_test(
    name = "deploy_test",
    srcs = [
        "download_test.go",
        "service_test.go",
    ],
    embed = [":deploy"],
    deps = [
        "//debugd/internal/filetransfer",
        "//debugd/service",
        "//internal/constants",
        "//internal/grpc/testdialer",
        "//internal/logger",
        "@com_github_spf13_afero//:afero",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_grpc//:grpc",
        "@org_uber_go_goleak//:goleak",
    ],
)
